package com.econ.powercloud.ems.common.enums;

/**
 * 并离网指令动作类型枚举
 *
 * @author jwc
 * @date 2022/08/29
 */
public enum GridActionTypeEnum implements EnumMethod{
    YX(1,"遥信"),
    YC(2,"遥测"),
    YK(3,"遥控"),
    YT(4,"遥调"),
    PEAK_SHIFT(5,"移峰填谷");

    private Integer code;
    private String desc;

    GridActionTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    public static String fromCode(Integer code) {
        for (GridActionTypeEnum obj : GridActionTypeEnum.values()) {
            if (code.equals(obj.getCode())) {
                return obj.getDesc();
            }
        }
        return null;
    }

}
